unit ReleaseJobs;

interface

uses
  System.SysUtils, System.Types, System.UITypes, System.Classes,
  System.Variants,
  FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.WebBrowser,
  FMX.Controls.Presentation, FMX.StdCtrls, Androidapi.JNI.libpingpp,
{$IF CompilerVersion >= 27.0} // >= XE6
  Androidapi.Helpers,
{$ENDIF}
{$IF CompilerVersion < 28.0} // < XE7
  FMX.Helpers.Android,
{$ENDIF}
  Androidapi.JNI.Util,
  Androidapi.JNI.JavaTypes,
   Androidapi.JNI.App,
  FMX.Platform.Android,
  IdHTTP;

type
  TForm2 = class(TForm)
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form2: TForm2;

implementation

{$R *.fmx}

procedure TForm2.FormShow(Sender: TObject);
var
  result: string;
  http: TIdHTTP;
  jsonToSend: TStringStream;
begin
  http := TIdHTTP.create(nil);
  jsonToSend := TStringStream.create('{"channel":"wx","amount":"1"}');
  try
    http.Request.ContentType := 'application/json';
    jsonToSend.Position := 0;
    result := http.Post('http://218.244.151.190/demo/charge', jsonToSend);
    TJPingpp.JavaClass.createPayment(SharedActivity,StringToJString(result));
  finally
    FreeAndNil(jsonToSend);
    FreeAndNil(http);
  end;
end;

end.
